package dao

import (
	"zg3/developer-branch/global"
	"zg3/developer-branch/internal/model"
)

// QueryHistory 关键词查询聊天记录
func QueryHistory(content string) []model.ChatRoomHistory {
	var result []model.ChatRoomHistory
	if err := global.DB.Debug().Where("content like ?", "%"+content+"%").Find(&result).Error; err != nil {
		return []model.ChatRoomHistory{}
	}
	return result
}
